export default {
    namespaced: true,
    state: {
        isShowToast: false,
        ToastText: '默认内容',
        ToastType: ''
    },
    getters: {
    },
    mutations: {
        isShowToast(state, payload) {
            state.isShowToast = payload.isShowToast
            if (state.isShowToast) {
                state.ToastText = payload.ToastText
                state.ToastType = payload.ToastType
            }
            // setTimeout(() => {
            //     this.isShowToast({ isShowToast: true })
            // }, 1500)
        }

    },
    actions: {
        asyncisShowToast({ commit }, payload) {
            commit('isShowToast', payload),
                setTimeout(() => {
                    commit('isShowToast', { isShowToast: false })
                }, 1500)
        }
    }

}